<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>用户登录</title>
        <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
        <meta content="yes" name="apple-mobile-web-app-capable"/>
        <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
        <meta content="telephone=no" name="format-detection"/>
        <link href="css/login.css" rel="stylesheet" type="text/css"/>
        <link href="css/aui/aui.css" rel="stylesheet" type="text/css"/>
        <script type="text/javascript" src="js/jquery.min.js" ></script>
        <script type="text/javascript" src="js/aui/aui-dialog.js" ></script>

    </head>
    <body>
        <section class="aui-flexView">
            <header class="aui-navBar aui-navBar-fixed b-line">
                <a href="javascript:history.back()" class="aui-navBar-item">
                    <i class="icon icon-return"></i>
                </a>
                <div class="aui-center">
                    <span class="aui-center-title" style="font-size: 16px;">登录</span>
                </div>
                <a href="signup" class="aui-navBar-item">
                    <i class="icon icon-sys"></i>注册
                </a>
            </header>#include('header.html')
            <section class="aui-scrollView">
                <div class="aui-code-box">
                    <form action="" method="post" onsubmit="return checkform()">
                        <p class="aui-code-line">
                            <input type="text" class="aui-code-line-input" value="${login}" name="login" id="login" autocomplete="off" placeholder="用户名/邮箱地址"/>
                        </p>
                        <p class="aui-code-line aui-code-line-clear">
                            <i class="aui-show  operate-eye-open"></i>
                            <input type="password" class="aui-code-line-input password" name="password" placeholder="密码" value="${pass}">
                        </p>
                        <div class="aui-flex-links" >
                            <a href="javascript:;">
                                <label class="cell-right" style="font-size: 14px;width: 82px;">
                                    <input type="checkbox" name="remember" ${remember}>
                                    <i class="cell-checkbox-icon" ></i>记住密码
                                </label>
                            </a>
                            <a href="forget" style="font-size: 14px;">忘记密码?</a>
                        </div>
                        <div class="aui-code-btn">
                            <button style="font-size: 14px;">登录</button>
                        </div>
                    </form>
                </div>
                <div class="aui-login-line">
                    <span style="color: #a5a5a5;font-size: 14px;">合作账号登录</span>
                </div>
                <div class="aui-login-armor">
                    <a href="https://graph.qq.com/oauth2.0/authorize?client_id=101566586&response_type=token&scope=all&redirect_uri=http://yaokui.ltd:9999/qqlogin.html" class="aui-tabBar-item qqlogin">
                        <img src="images/icon-sin-001.png" alt="">
                    </a>
                </div>
            </section>
        </section>
        <script type="text/javascript">
            $('.aui-show').click(function() {
                var pass_type = $('input.password').attr('type');

                if (pass_type === 'password') {
                    $('input.password').attr('type', 'text');
                    $('.aui-show').removeClass('operate-eye-open').addClass('operate-eye-close');
                } else {
                    $('input.password').attr('type', 'password');
                    $('.aui-show').removeClass('operate-eye-close').addClass('operate-eye-open');
                }
            })
        </script>
        <script>
            var app =0;
            if (travel.checkApp()) {
                app = 1;
                $(".qqlogin").attr("href","javascript:travel1.qqlogin();")
            }
        </script>
        <script type="text/javascript">
        var dialog = new auiDialog({})
            function checkform(){
                $.ajax({
                    url:"dologin",
                    dataType:"json",
                    type:"post",
                    data:$("form").serialize(),
                    success:function(result){
                        if(result.status=="1"){
                            #if(uri!=null&&uri!=""&&uri!="index")
                                app = 0;
                            #end
                            if (app==0) {
                                dialog.alert({
                                    msg: '登录成功。',
                                    buttons: ['确定']
                                }, function (ret) {
                                    location.href = "${uri==''?'index':uri}";
                                });
                            }
                            else{
                                travel1.login();
                            }
                        }
                        else {
                            dialog.alert({
                                msg:''+result.tips,
                                buttons:['确定']
                            });
                        }
                    },
                    error:function(result){
                        console.log(result);
                        dialog.alert({
                            msg:'系统繁忙！',
                            buttons:['确定']
                        });
                    }
                });
             
                return false;
            }
        </script> 

    </body>
</html>
